package com.spzx.test1.t13;
/*
    并非全力
*/

import lombok.SneakyThrows;

public class Test1 {

    public static void main(String[] args) {

        BreadRoom br = new BreadRoom();

        new Thread(() -> {
            for (int i = 0; i < 20; i++) {
                try {
                    br.put("面包" + i);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            }
        },"面包大师").start();


        new Thread(() -> {
            for (int i = 0; i < 10; i++) {
                try {
                    System.out.println("顾客吃"+br.get());
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            }
        },"顾客").start();

    }

}
